package com.zcx.controller;


import com.zcx.common.vo.ApiResult;
import com.zcx.pojo.Menu;
import com.zcx.service.IMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zcx
 * @since 2022-03-31
 */
@Controller
@RequestMapping("/menu")
public class MenuController {
    @Autowired
    IMenuService menuService;
    @ResponseBody
    @RequestMapping("/list")
    public ApiResult queryAllMenu(){
        List<Menu> menus = menuService.queryAllMenu();
        return ApiResult.success("查询所有菜单",menus);
    }
}

